<template>
  <div class="bread-container">
    <div class="bread-header">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>活动管理</el-breadcrumb-item>
        <el-breadcrumb-item>活动列表</el-breadcrumb-item>
        <el-breadcrumb-item>活动详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <!-- tag标签组件 -->
    <div class="tag-container" @click.prevent="changeMenuList">
      <a
        href="###"
        class="tag-el"
        v-for="(item, index) in activeNavList"
        :key="index"
        :class="{ active: item === activeName }"
        >{{ item }}<i class="el-icon-close"></i
      ></a>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    //   用户每次点击添加的数组
    activeNavList: {
      type: Array,
      required: true,
      default: '',
    },
    // 用户每次点击的那个传递进来的动态数据
    activeName: {
      type: String,
      required: true,
      default: '',
    },
  },
  data() {
    return {};
  },
  created() {
    console.log(this.activeNavList);
  },
  methods: {
    changeMenuList() {
      console.log(1);
    },
  },
};
</script>

<style lang="less" scoped>
.bread-header {
  .el-breadcrumb {
    border-bottom: 1px solid #efefef;
    padding-left: 20px;
    padding-bottom: 10px;
  }
}
.tag-container {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #efefef;
  .tag-el {
    display: block;
    min-width: 70px;
    padding-top: 4px;
    padding-bottom: 4px;
    margin: 0 5px;
    font-size: 10px;
    border: 1px solid #efefef;
    color: #333;
    // background-color: #42b983;
    //  padding: 4px 5px;
    text-decoration: none;

    &::before {
      content: '';
      background-color: #fff;
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 4px;
    }
    i.el-icon-close {
      font-size: 8px;
      margin-left: 5px;
    }
  }
  //动态样式
  .active {
    color: #fff;
    background-color: #42b983;
    padding: 4px 5px;
  }
  /deep/.el-breadcrumb {
    padding-left: 30px !important;
  }
}
</style>
